<?php
$user = new stdClass();
$user->fullname = '';
$user->phone = '';
$user->email = '';
$user->local = '';
$user->district = '';
$user->address = '';
if(is_user_logged_in()){
    global $current_user;
    //get_user_meta($user_id, $key, $single);
    $user_id =  $current_user->ID;
    $user->email = $current_user->user_email;
    $user->fullname = $current_user->display_name;
    $user->address = get_user_meta($user_id, 'address', true);
    $user->phone = get_user_meta($user_id, 'phone', true);
}
if(isset($_SESSION['customers']) && isset($_SESSION['customers']['buy'])){
	$customer = $_SESSION['customers']['buy'];
	foreach($customer as $key => $value){
		$user->{$key} = $value;
	}
}
?>
<div class="thongtin-nguoimua">
    <div class="form-horizontal">
        <div class="control-group">
            <label class="control-label" for="fullname">Họ tên*:</label>
            <div class="controls">
                <input value="<?php echo $user->fullname;?>" class="input-large required" type="text" name="buy_fullname" placeholder="Họ tên" />
            </div>
        </div>
        
        <div class="control-group">
            <label class="control-label" for="phone">Số điện thoại*:</label>
            <div class="controls">
                <input value="<?php echo $user->phone;?>" class="input-large required" type="text" name="buy_phone" placeholder="Điện thoại" />
            </div>
        </div>
        
         <div class="control-group">
            <label class="control-label" for="email">Email*:</label>
            <div class="controls">
                <input value="<?php echo $user->email;?>" class="input-large required" type="text" name="buy_email" placeholder="Email" />
            </div>
        </div>
    
        <div class="control-group">
            <label class="control-label" for="local">Tỉnh/Thành*:</label>
            <div class="controls">
                <input value="<?php echo $user->local;?>" class="input-large required" type="text" name="buy_local" placeholder="Tỉnh/Thành" />
            </div>
        </div>
        
        <div class="control-group">
            <label class="control-label" for="district">Quận/Huyện*:</label>
            <div class="controls">
                <input value="<?php echo $user->district;?>" class="input-large required" type="text" name="buy_district" placeholder="Quận/Huyện" />
            </div>
        </div>
        
         <div class="control-group">
            <label class="control-label" for="address">Địa chỉ*:</label>
            <div class="controls">
                <input value="<?php echo $user->address;?>" class="input-large required" type="text" name="buy_address" placeholder="Địa chỉ" />
            </div>
        </div>
        
    </div>
</div>